package com.xiaohudie.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author xiao hu die
 * @Date 2022/3/10 22:19
 * @Version 1.0
 */
@Configuration
public class RedisConfig {
@Bean
    public RedissonClient redissonClient(){
    /**配置类*/
    Config config = new Config();
    /**添加redis地址
     * 集群使用config.useClusterServers*/
    config.useSingleServer().setAddress("redis://112.124.39.228:6379");
    /**创建客户端*/
    return Redisson.create(config);
}
}
